/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.chlitina.store.modules.sms.entity;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

import com.chlitina.store.common.persistence.BaseEntity;
import com.chlitina.store.modules.sys.entity.Area;

/**
 * 店面诊断模板区域设置Entity
 * @author liujiang
 * @version 2013-08-01
 */
@Entity
@Table(name = "store_diagnose_setting")
@IdClass(DiagnoseAreaPK.class)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class StoreDiagnoseSetting extends BaseEntity {
	
	private static final long serialVersionUID = 1L;
	private Area area; // 区域
	private StoreDiagnoseTemplate storeDiagnoseTemplate; // 店面诊断模板

	public StoreDiagnoseSetting() {
	}

	public StoreDiagnoseSetting(Long id){
		this();
	}
	
	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="AREA_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public Area getArea() {
		return area;
	}

	public void setArea(Area area) {
		this.area = area;
	}


	@Id
	@ManyToOne(cascade={CascadeType.REFRESH},fetch = FetchType.LAZY)
	@JoinColumn(name="SDT_ID")
	@NotFound(action = NotFoundAction.IGNORE)
	@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
	@NotNull
	public StoreDiagnoseTemplate getStoreDiagnoseTemplate() {
		return storeDiagnoseTemplate;
	}

	public void setStoreDiagnoseTemplate(StoreDiagnoseTemplate storeDiagnoseTemplate) {
		this.storeDiagnoseTemplate = storeDiagnoseTemplate;
	}
}